<?php

class Welcome extends Controller {

	function Welcome()
	{
		parent::Controller();
		if(! $this->dx_auth->is_logged_in()	){
			redirect('/auth/login/', 'refresh');
		}
	}
	
	function index()
	{
		$this->load->model('dx_auth/users','UserCtrl');
		$this->load->model('dx_auth/roles','UserRoleCtrl');
		
		$userID = $this->session->userdata('DX_user_id');
		
		$qryUserData = $this->UserCtrl->get_user_by_id($userID);
		
			$user = $qryUserData->row_array();
			
			$var['userName'] = $user['username'];
			$roleID = $user['role_id'];
		
		$qryUserRole = $this->UserRoleCtrl->get_role_by_id($roleID);
		
			$role = $qryUserRole->row();
			$var['userRole'] = $role->name;
	
		
		
		
		$var['title_for_layout'] = "Welcome";
		$this->layout->view('home/_index',$var);
	}
}

/* End of file welcome.php */
/* Location: ./system/application/controllers/welcome.php */